home *** CD-ROM | disk | FTP | other *** search
- /*
- * build pcboard dir.lst
- */
-
- #include <ctype.h>
- #include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- #if 0
- 123456789012345678901234567890
- J:\BBS\PCB\ADA
- 12345678901234567890123456789012345678901234567890123456789012345
- E:\MSDOS\ADA\
- #endif
-
- #include <stdio.h>
-
- /*
- * description file, directory where files are, directory description
- */
- void _Cdecl
- main(int argc, char *argv[]) {
- char buf[200];
- char buf1[80];
- char buf2[80];
- char buf3[80];
- int len;
- char *p;
-
- strcpy(buf1, argv[1]);
- buf1[30] = '\0';
- strcpy(buf2, argv[2]);
- buf2[30] = '\0';
-
- len = strlen(argv[3]);
- if (!len) {
- fprintf(stderr, "dirlst: no area path found.\n");
- exit(1);
- }
-
- buf3[0] = '\0';
- while (NULL != gets(buf)) {
- if (0 == strncmpi(argv[3], buf, len)) {
- p = buf + len;
- while (isspace(*p))
- ++p;
- strcpy(buf3, p);
- buf3[35] = '\0';
- break;
- }
- }
- if (! buf3[0]) {
- fprintf(stderr, "no area found:\n%s\n", argv[3]);
- exit(1);
- }
-
- printf("%-30s%-30s%-35s", buf1, buf2, buf3);
- exit(0);
- }
-